var g = Graphics.createArrayBuffer(32,32,8);
g.dump = _=>{
  var s = "";
  var b = new Uint8Array(g.buffer);
  var n = 0;
  for (var y=0;y<g.getHeight();y++) {
    s+="\n";
    for (var x=0;x<g.getWidth();x++) 
      s+=".#XO+"[b[n++]];
  }
  return s;
}
g.print = _=>{
  print("`"+g.dump()+"`");
}
var ok = true;
function SHOULD_BE(a) {
  var b = g.dump();
  if (a!=b) {
    console.log("GOT :"+b+"\nSHOULD BE:"+a+"\n================");
    ok = false;
  }
}

g.setColor(1);

g.clear();
g.fillCircle(16,16,12)
SHOULD_BE(`
................................
................................
................................
................................
............#########...........
..........#############.........
........#################.......
.......###################......
......#####################.....
......#####################.....
.....#######################....
.....#######################....
....#########################...
....#########################...
....#########################...
....#########################...
....#########################...
....#########################...
....#########################...
....#########################...
....#########################...
.....#######################....
.....#######################....
......#####################.....
......#####################.....
.......###################......
........#################.......
..........#############.........
............#########...........
................................
................................
................................`);

g.clear();
g.drawCircle(16,16,12)
SHOULD_BE(`
................................
................................
................................
................................
.............#######............
...........##.......##..........
.........##...........##........
........#...............#.......
.......#.................#......
......#...................#.....
......#...................#.....
.....#.....................#....
.....#.....................#....
....#.......................#...
....#.......................#...
....#.......................#...
....#.......................#...
....#.......................#...
....#.......................#...
....#.......................#...
.....#.....................#....
.....#.....................#....
......#...................#.....
......#...................#.....
.......#.................#......
........#...............#.......
.........##...........##........
...........##.......##..........
.............#######............
................................
................................
................................`);
//g.print();

result=ok;
